<div class="layui-side layui-bg-black">
	<div class="layui-side-scroll">
		<#include "/apps/business/workordersthree/include/left.html">
	</div>
</div>
<div class="layui-body">
	<#if workOrdersList?? && workOrdersList.content?? && workOrdersList.content?size gt 0>
	<div class="layui-side-scroll">
		<div class="ukefu-containter">
			<div class="ukefu-col-left" id="ukefu-workorders-list">
				<h1 class="site-h1" style="border-top:1px solid #e6e6e6;">
					<form class="layui-form" name="search" action="/apps/workordersthree/workitem.html" method="get" style="width:99%;overflow:hidden;">
						<div class="layui-form-item" style="width:100%;">
							<div class="layui-inline" style="width:100%;">
								<div class="layui-input-inline" style="width:100%;">
									<input type="text" name="q" value="${q!''}" style="height: 30px;line-height: 30px;margin-top: 4px;border: 1px solid ${systemConfig.styleColor!'#32c24d;'};" placeholder="请输入查询条件" autocomplete="off" class="layui-input">
									<i class="layui-icon" onclick="search.submit()" style="position: absolute;cursor: pointer;right: 3px;top: 4px;font-size: 20px;color:${systemConfig.styleColor!'#32c24d;'};"></i>
								</div>
							</div>
						</div>
					</form>
				</h1>
				<ul id="workOrdersPages">
					<#assign tpWorkOrders = workOrders>
					<#if workOrdersList?? && workOrdersList.content??>
					<#list workOrdersList.content as workOrders>
					<li class="ukefu-workorders-list-item" <#if tpWorkOrders?? && tpWorkOrders.id == workOrders.id>style="background-color: #ededed;"</#if>>
						<div class="ukefu-workorders-number" id="fav_${workOrders.id!''}">
							<#include "/apps/business/workordersthree/orderno.html">
						</div>
						<div class="ukefu-workorders-priority">
							<#list uKeFuDic["com.dic.workorders.priority"] as workOrdersStatus>
							<#if workOrdersStatus.id == workOrders.priority>
							<i class="kfont" <#if workOrdersStatus.iconskin?? && workOrdersStatus.iconskin != "">style="color:${workOrdersStatus.iconskin}"</#if> title="${workOrdersStatus.name!''}">&#xe82d;</i>
							</#if>
							</#list>
						</div>
						<a href="/apps/workordersthree/workitem/detail.html?id=${workOrders.id!''}" data-toggle="load" data-target="#workordersdetail"  >
						<div class="ukefu-workorders-block">
							<div class="ukefu-workorders-title">
								${(workOrders.title!'')?no_esc}
							</div>
						</div>
						<div class="ukefu-workorders-block">
							<div class="ukefu-workorders-contacts">
								联系人：<#if workOrders.contacts??>${workOrders.contacts.name!''}</#if>
							</div>
						</div>
						<div class="ukefu-workorders-block">
							<div class="ukefu-workorders-status">
								状态：
								<#list uKeFuDic['com.dic.workorders.status'] as workOrdersStatus>
								<#if workOrdersStatus.id == workOrders.status || workOrdersStatus.code == workOrders.status>
								<small class="ukefu-label" <#if workOrdersStatus.iconskin?? && workOrdersStatus.iconskin != "">style="background-color:${workOrdersStatus.iconskin}"</#if>>${workOrdersStatus.name!''}</small>
								</#if>
								</#list>
							</div>
						</div>
						<div class="ukefu-workorders-block">
							<div class="ukefu-workorders-time">
								更新时间：<#if workOrders?? && workOrders.updatetime??>${workOrders.updatetime?string("yyyy-MM-dd HH:mm:ss")}</#if>
							</div>
						</div>
						</a>
					</li>
					</#list>
					</#if>
				</ul>
			</div>
			<div class="ukefu-col-right">
				<div class="ukefu-workorders-body" id="workordersdetail">
					<#include "/apps/business/workordersthree/workitem/detail.html">
				</div>
			</div>
		</div>
	</div>
	<#else>
	<div class="box default-box" style="height: 100%;">
		<div class="box-header">
			<h3 class="box-title">待处理工单</h3>
		</div>
		<div class="box-body ukefu-im-theme">
			<div class="ukefu-empty">
				<i class="layui-icon"></i>
				<div style="">
					还没有工单记录 ，您可以 
					<a class="layui-btn layui-btn-sm green" href="/apps/workordersthree/add.html" title="创建新工单">
						<i class="layui-icon"></i>
						创建新工单
					</a>
				</div>
			</div>	
		</div>
	</div>
	</#if>
</div>
<script language="javascript"> 		
	layui.use('form', function(){
		var form = layui.form;
	});
	layui.use(['element', 'flow'], function() {
		var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
		var flow = layui.flow;
		flow.load({
		    elem: '#ukefu-workorders-list' //指定列表容器
		   	,scrollElem:".ukefu-col-left"
		    ,done: function(page, next){ //到达临界点（默认滚动触发），触发下一页
		      $.get('/apps/workordersthree/pages.html?<#if q??>q=${q!''}&</#if>tp=${subtype}&p='+(page+1), function(res){
		        //假设你的列表返回在data集合中
		        
		        //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
		        //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
		        next($('#workOrdersPages').append(res) , $(res).length > 0);    
		      });
		    }
		});
	});
	$('.ukefu-workorders-list-item').on("click" , function(){
		$('.ukefu-workorders-list-item').css("background-color" , "#FFFFFF") ;
		$(this).css("background-color" , "#ededed") ;
		
	})
			
</script>